﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserDetail.aspx.cs" Inherits="Manage_basisset_UserDetail" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>添加用户</title>
    <link rel="stylesheet" type="text/css" href="../skin/css/base.css" />
    <script type="text/javascript">

        function checkForm() {
            var control = document.getElementById("txtname");
            var code = document.getElementById("txtcode");
            var pwd = document.getElementById("txtpwd");
            var confirmpwd = document.getElementById("txtconfirmpwd");
            var group = document.getElementById("ddlgroup");
            var userid = document.getElementById("hdfuserid");
            if (control.value.length == 0) {
                alert("用户名称不能为空！");
                control.focus();
                return false;
            }
            if (code.value.length == 0) {
                alert("用户编号不能为空！");
                code.focus();
                return false;
            }
            if (group.value== 0) {
                alert("请选择组别！");
                group.focus();
                return false;
            }
            if (userid.value == 0 && pwd.value.length == 0) {
                alert("登录密码不能为空！");
                pwd.focus();
                return false;
            }
            if (userid.value == 0 && confirmpwd.value.length == 0) {
                alert("确认密码不能为空！");
                confirmpwd.focus();
                return false;
            }
            if (pwd.value!=confirmpwd.value) {
                alert(" 2次密码输入不一致,请重新输入！");
                pwd.focus();
                return false;
            }
        }
  </script>
<style type="text/css">
.STYLE4 {
	font-size: 16px;
	color: #FF0000;
}
.STYLE5 {color: #FF0000}
.cbox{ border:none}
    .style1
    {
        width: 29%;
    }
    .style2
    {
        width: 30%;
    }
</style>
</head>
<body leftmargin="8" topmargin="8" background='../skin/images/allbg.gif'>
    <form id="form1" runat="server">
 
    <asp:ScriptManager ID="ScriptManager1" runat="server"  EnableScriptGlobalization="True" EnableScriptLocalization="True">
        </asp:ScriptManager>
    <!--  快速转换位置按钮  -->
    
   
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
        <tr>
            <td height="26" background="../skin/images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="center"><span style="font-size:14px; font-weight:bold">用户详细信息</span></td>
                        <td  align="right"  style="width:60px">
                        <asp:Button ID="btnreturn" class="coolbg_add" runat="server" Text="返回列表" onclick="btnreturn_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
<!--  内容列表   -->
<asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <div >
    
      <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
        <tr bgcolor="#E7E7E7">
          <td height="24" colspan="5" background="../skin/images/tbg.gif"><div align="left" >
              用户基本信息</div></td>
        </tr>
       
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
          <td width="13%" align="left"><div align="left">用户编号：<span class="STYLE5">*</span></div></td>
           <td class="style1"><div align="left">
            
              <asp:TextBox ID="txtcode" runat="server" Width="200px"></asp:TextBox>
              <asp:HiddenField ID="hdfuserid" runat="server" Value="0" />
            </div></td>
             <td width="13%" align="left"><div align="left">用户名称：<span class="STYLE5">*</span></div></td>
             <td class="style2"><div align="left">
            
              <asp:TextBox ID="txtname" runat="server" Width="200px"></asp:TextBox>
            </div></td>
          <td width="20%"></td>
        </tr>
       <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
          <td width="13%" align="left"><div align="left">用户分组：<span class="STYLE5">*</span></div></td>
           <td class="style1"><div align="left">
               <asp:DropDownList ID="ddlgroup" runat="server" ></asp:DropDownList> 
            </div></td>
             <td width="13%" align="left"><div align="left">用户状态：<span class="STYLE5">*</span></div></td>
             <td class="style2"><div align="left">
             <asp:RadioButtonList ID="rbtlIsvalid"  runat="server" RepeatDirection="Horizontal" CssClass="cbox"  BorderStyle="None" BorderWidth="0">
                  <asp:ListItem Text="禁用" Value="0" ></asp:ListItem>
                  <asp:ListItem Text="启用" Value="1" Selected="True"></asp:ListItem>
             </asp:RadioButtonList>
            </div></td>
          <td width="20%"></td>
        </tr>
          <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
          <td width="13%" align="left"><div align="left">登录密码：</div></td>
           <td class="style1"><div align="left">
                <asp:TextBox ID="txtpwd" TextMode="Password" runat="server"></asp:TextBox>
               <asp:Label ID="lblmsg1" runat="server" Text="不修改密码此填入框留空" CssClass="STYLE5"></asp:Label>
            </div></td>
             <td width="13%" align="left"><div align="left">确认密码：</div></td>
             <td class="style2"><div align="left">
              <asp:TextBox ID="txtconfirmpwd" runat="server" TextMode="Password"></asp:TextBox>
              <asp:Label ID="lblmsg2" runat="server" Text="不修改密码此填入框留空" CssClass="STYLE5"></asp:Label>
            </div></td>
          <td width="20%"></td>
        </tr>
      </table>
        
       <asp:UpdatePanel id="UpdatePanelAccount" runat="server" ChildrenAsTriggers="true"  UpdateMode="Conditional">
                    <contenttemplate>
    <%if(groupName=="Administrators"&&username=="Admin"){ %>
      <table width="98%" border="0" align="center" style="margin-top:8px;display:none;">
      <%}else{ %> 
        <table width="98%" border="0" align="center" style="margin-top:8px;display:block">
        <% } %> 
           <tr>

             <td>
                <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
        <tr bgcolor="#E7E7E7">
          <td height="24" colspan="5" background="../skin/images/tbg.gif"><div align="left" >
              用户权限列表</div></td>
        </tr>
       </table>
             </td>
           </tr>
           <tr style="background-color:#ffffff">
            <td >
        <asp:GridView ID="grdvPermision" runat="server" Width="100%" CellPadding="4" BorderColor="#D1DDAA"  
                            AutoGenerateColumns="False" AllowPaging="False" PageSize="12" 
                            DataKeyNames="MenuId"  DataMember="Name" 
                    OnRowDataBound="grdvPermision_RowDataBound" GridLines="Both" 
                    onrowcommand="grdvPermision_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="菜单项">
                                    <ItemTemplate>
                                       <asp:Label ID="lblname" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="权限选择">
                                    <ItemTemplate>
                                      <div style="float:left; margin-right:8px"> <asp:CheckBoxList ID="ckblpermision" runat="server"  BorderStyle="None"  BorderWidth="0"  CssClass="cbox"   RepeatDirection="Horizontal"  > 
                                       </asp:CheckBoxList></div>
                                     <div style="float:left"> <asp:CheckBox ID="ckall" runat="server" Text="全部权限" 
                                             oncheckedchanged="ckall_CheckedChanged"   AutoPostBack="true"   /></div> 
                                       <asp:HiddenField ID="hdfMenuId" runat="server" Value='<%#Eval("MenuId") %>' />
                                       <asp:HiddenField ID="hdfPermisionNew" runat="server" Value='<%#Eval("NEW") %>' />
                                       <asp:HiddenField ID="hdfPermisionSelect" runat="server" Value='<%#Eval("SELECT") %>' />
                                        <asp:HiddenField ID="hdfPermisionEdit" runat="server" Value='<%#Eval("EDIT") %>' />
                                        <asp:HiddenField ID="hdfPermisionDelete" runat="server" Value='<%#Eval("DELETE") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                            </Columns>
                            <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#FFFFFF" ForeColor="#000000" />
                            <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#FCFDEE" />
                            <SelectedRowStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="#000000" />
                            <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#FCFDEE"  ForeColor="000000" />
                            <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                            
                        </asp:GridView>
                        </td>
                        </tr>
                        <tr bgcolor="#FAFAF1">
        <td height="28"  style="padding-left:10px">
           
	        <asp:CheckBox ID="chkSelect" runat="server" Text="全选" 
                oncheckedchanged="chkSelect_CheckedChanged" AutoPostBack="true" />
        </td>
        </tr>
        
       </table>
       </contenttemplate>
                      
                    </asp:UpdatePanel>
      <!--  提交 -->
      <table width='98%'  border='0' cellpadding='1' cellspacing='1' bgcolor='#CBD8AC' align="center" style="margin-top:8px">
        <tr bgcolor='#EEF4EA'>
          <td background='skin/images/wbg.gif' align='center'><table border='0' cellpadding='0' cellspacing='0'>
              <tr>
                <td width='90' align='center'>&nbsp;</td>
                <td width='70'>&nbsp;</td>
                <td width='160'><asp:Button ID="btnsave" runat="server" Text="保存" 
                        OnClientClick="return checkForm();false" onclick="btnsave_Click" /></td>
                <td width='110'>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
       
    </div>
      </ContentTemplate>
      <Triggers><asp:AsyncPostBackTrigger ControlID="btnsave" EventName="Click" /></Triggers>
    </asp:UpdatePanel>
    </form>
   
</body>
</html>
